﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AppShare.Web
{
    public partial class Guide : System.Web.UI.Page
    {
        private WikiPage wiki;

        protected void Page_Load(object sender, EventArgs e)
        {
            var key = this.Request.QueryString["wiki"];
            if (key == null)
                throw new Exception("QueryString wiki does not exist!");

            wiki = SharedUtil.GetWikiPage(key.ToLower());

            this.Title = wiki.Title;

            wikiRender.DataSource = wiki.Contents;
            wikiRender.DataBind();
        }

        public WikiPage Wiki
        {
            get
            {
                return wiki;
            }
        }
    }
}